#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :ThreePrice.py
# @Time      :2024/11/11 21:57
# @Author    :zhou_yi

from datetime import datetime
from pydantic import BaseModel, Field
from typing import Optional
from settings import DefaultSignalPrice
from models.BaseModels import CompanyBaseModel


# 输入的模型
class InputThreePrice(BaseModel):
    tpl: str
    partA: str
    start: datetime
    end: datetime
    companies: list[str]
    prices: Optional[list[float]] = DefaultSignalPrice
    nums: int = 1


# 比价公司
# class PriceCompany(BaseModel):
#     name: str
#     address: Optional[str]
#     user: Optional[str]
#     tel: Optional[str] = Field(alias='tel_2')
#     signal_price: str
#     service_date: str
#     months: str
#     nums: str
#     signal_price: str
#     price: str
#     up_price: str
#     sign_date: str
#
#     class Config:
#         extra = "ignore"


class PriceCompany(CompanyBaseModel):
    tel: Optional[str] = Field(alias='tel_2')
    signal_price: str
    service_date: str
    months: str
    nums: str
    signal_price: str
    price: str
    up_price: str
    sign_date: str


# 生成的模型
class OutThreePrice(BaseModel):
    partA: str
    service_date: str
    three: list[PriceCompany]


if __name__ == '__main__':
    ...
